<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="https://cdn.jsdelivr.net/npm/vue@2.6.0"></script>
    <script src="https://unpkg.com/axios/dist/axios.min.js"></script>
    <style>
        body{
            background-image: linear-gradient(to right, red ,black, rgb(25, 0, 255));
        }
        .container{
            background-image: linear-gradient(to left, red ,rgb(102, 91, 91), rgb(25, 0, 255));
            width: 600px;
            height: 400px;
            position: absolute;
            left: 50%;
            top: 50%;
            margin-left: -300px;
            margin-top: -200px;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
        }
        input{
            width: 400px;
            height: 60px;
            font-size: 24px;
            color: whitesmoke;
            background-color: transparent;
            margin-bottom: 30px;
        }
        button{
            outline: none;
            border: 0;
            width: 200px;
            background-image: linear-gradient(to left, red ,rgb(102, 91, 91), rgb(25, 0, 255));
            color: whitesmoke;
            font-size: 18px;
            height: 60px;
        }
        
    </style>
</head>
<body>
    <div id="app">
       <div id="container" class="container">
           <input type="text" placeholder="Please input your Name" v-model="loginName">
           <input type="password" placeholder="Please input your password" v-model="loginPsd">
           <button @click="login">登陆</button>
       </div>
    </div>
</body>
<script>
 var vm = new Vue({
     el:'#app',
     data:{
         message:'zhanghao',
         loginName:null,
         loginPsd:null,
         isOk:null
     },
     methods:{
         handelclick(){
             console.log(this.loginName);
             console.log(this.loginPsd)
         },
         login(){
             axios.post('http://localhost:3000/login',{
                loginName:this.loginName,
                loginPsd:this.loginPsd
             }).then(res=>{
                 console.log(res);
                 if(res.data.isok){
                    window.location.href='user.html'
                 }else{
                     alert('请填写')
                 }
                 
             })
         }
     }
 })
</script>
</html>